/**
 * 删除
 * */
// ===================================================================== Lazy
const Confirm = window.$Lazy.file(()=>import('@antd/common/confirm-submit'))
// ===================================================================== 
const Index = function(api, option){
	let { label='删除', param, query, uuid, idStr='uuid', isKeys, disabled, onComplete } = option || {}
	
	disabled = isKeys && !disabled ? { disabled: !window.$fn.hasArray(this.state.selectedKeys) } : { disabled }
	 
	return { label, loading:this.state.pagingLoading, ...disabled,  onClick:()=>{
		param = query ? query : { [idStr]: uuid ? uuid : this?.state?.selectedKeys, ...param  }
		Confirm.then( f=> f.call(this, api, { title:label, param, clear:true, onComplete }))
	}}
}
export default Index